import request from '@/utils/request'

const memberApi = {

}

/**
 * 获取会员信息分页列表
 * @param data
 * @returns {AxiosPromise}
 */
memberApi.getPageList = data => {
  return request({
    url: '/sysMember/getPageList',
    method: 'post',
    data
  })
}

/**
 * 获取会员信息详情
 * @param data
 * @returns {AxiosPromise}
 */
memberApi.detail = id => {
  return request({
    url: '/sysMember/findMemberById/' + id,
    method: 'get'
  })
}

/**
 * 新增会员信息
 * @param data
 * @returns {AxiosPromise}
 */
memberApi.add = data => {
  return request({
    url: '/sysMember/add',
    method: 'post',
    data
  })
}

/**
 * 修改会员信息
 * @param data
 * @returns {AxiosPromise}
 */
memberApi.update = data => {
  return request({
    url: '/sysMember/update',
    method: 'post',
    data
  })
}

/**
 * 逻辑删除会员信息
 * @param data
 * @returns {AxiosPromise}
 */
memberApi.delete = id => {
  return request({
    url: '/sysMember/deleteMemberById/' + id,
    method: 'get'
  })
}

/**
 * 批量删除
 * @param data
 * @returns {AxiosPromise}
 */
memberApi.detdeleteBatchIds = ids =>{
  return request({
    url: '/sysMember/deleteBatchIds/' ,
    method: 'post',
    data: ids
  })
}


/**
 * 上传用户头像
 * @param data
 * @returns {AxiosPromise}
 */
memberApi.uploadHead = data => {
  return request({
    url: '/sysMember/uploadHead',
    method: 'post',
    data
  })
}

/**
 * 管理员重置用户密码
 * @param data
 * @returns {AxiosPromise}
 */
memberApi.resetPassword = data => {
  return request({
    url: '/sysMember/resetPassword',
    method: 'post',
    data
  })
}

export default memberApi
